using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Graphics.PackedVector;

namespace Jemgine.Particles
{
    public struct Particle
    {
        internal Vector2 position;
        internal Vector4 color;
        internal float scale;
        internal float angle;
        internal float age;
        internal Vector2 velocity;
    }

    public struct ParticleVertex
    {
        public Short2 Corner;
        public Vector2 Position;
        public Vector4 Color;
        public float Scale;
        public float Angle;

        public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(
            new VertexElement(0, VertexElementFormat.Short2, VertexElementUsage.Position, 0),
            new VertexElement(4, VertexElementFormat.Vector2, VertexElementUsage.Position, 1),
            new VertexElement(12, VertexElementFormat.Vector4, VertexElementUsage.Color, 0),
            new VertexElement(28, VertexElementFormat.Single, VertexElementUsage.TextureCoordinate, 0),
            new VertexElement(32, VertexElementFormat.Single, VertexElementUsage.TextureCoordinate, 1)
            );

        public const int SizeInBytes = 36;
    }
}
